package com.mingqi.enetconnected.net.request;

import android.content.Context;

import com.google.gson.reflect.TypeToken;
import com.mingqi.enetconnected.data.bean.order.SecurityRisksOrder;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;

public class SubsRemoteRequest {
    /**
     * 用户安全隐患查询
     */
    public final static String SECURITY_RISKS = "/v1/crm/service/securityRisks?subsCode={subsCode}";

    /**
     * 用户安全隐患查询
     *
     * @param cxt
     * @param subsCode 户号
     * @param state 状态
     * @return
     * @throws Exception
     */
    public static List<SecurityRisksOrder> getSecurityRisks(Context cxt, String subsCode, char state) throws Exception {
        Type type = new TypeToken<List<SecurityRisksOrder>>() {
        }.getType();
        Communicator<List<SecurityRisksOrder>> communicator = new Communicator<>(cxt, SECURITY_RISKS);
        HashMap<String, String> params = new HashMap<>();
        params.put("subsCode", subsCode);
        params.put("state", String.valueOf(state));
        return communicator.get(params, type);
    }

}
